clear all
global system "linux"

if "${system}" == "linux" {
	*global code "/"
	global code "/"
	global s "/"
}

run "${code}${s}_set-path.do"


***** Prep the data
qui do "${code}/tba_elig/_jumbo-confidence_levelorming-dataprep.do"


***** tba eligibility share by loan size
use "${temp}/embs-417k.dta", clear
keep if orig_ym <= ym(2012, 12)
do _jumbo-confidence_levelorming-sampleselection
keep if inrange(baldiff, -200, 200) 

replace baldiff = ceil(baldiff/ 2.5)* 2.5
collapse tbaelig, by(baldiff) fast
twoway line tbaelig baldiff, xline(0, lpattern(dash) lcolor(gs8)) xlabel(-200(100)200) xtitle("Loan Size - National CLL ($1000)", size(medlarge)) ytitle("") ylabel(, angle(0))
graph export "${figure}/LoanAmt-TBAelig.pdf", replace


